package com.huabo.audit.controller;

import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfig;

import com.hbfk.util.JsonBean;
import com.hbfk.util.ResponseFormat;
import com.huabo.audit.service.AttachmentService;
import com.huabo.audit.service.TblNbsjAdvicenoteService;
import com.huabo.audit.service.TblNbsjAuditplanService;
import com.huabo.audit.service.TblNbsjAuditprogramService;
import com.huabo.audit.service.TblNbsjBorrowRecordService;
import com.huabo.audit.service.TblNbsjBugCriterionService;
import com.huabo.audit.service.TblNbsjFactbookService;
import com.huabo.audit.service.TblNbsjInnerRuleService;
import com.huabo.audit.service.TblNbsjOuterruleService;
import com.huabo.audit.service.TblNbsjProjectService;
import com.huabo.audit.service.TblNbsjSheetService;
import com.huabo.audit.service.TblNbsjTargettypeService;
import com.huabo.audit.service.TblNbsjTempleteService;
import com.huabo.audit.service.TblNbsjTypeService;
import com.huabo.audit.service.TblOrganizaService;
import com.huabo.audit.service.TblOtherarticleService;
import com.huabo.audit.service.TblReportService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;

/**
 * 审计工作台
 */
@RestController
@Slf4j
@Api(value ="审计流程", tags = {"审计流程相关" })
@RequestMapping(value ="/nbsjapproval")
public class NbsjApprovalController {
	
	@Resource
	public AttachmentService attachmentService;
	@Resource
	public TblNbsjTempleteService tblNbsjTempleteService;
	@Resource
	public TblNbsjTargettypeService tblNbsjTargettypeService;
	@Resource
	public TblNbsjAuditprogramService tblNbsjAuditprogramService;
	@Resource
	public TblNbsjOuterruleService tblNbsjOuterruleService;
	@Resource
	public TblNbsjInnerRuleService tblNbsjInnerRuleService;
	@Resource
	public TblNbsjBugCriterionService  tblNbsjBugCriterionService;
	@Resource
    private TblNbsjTypeService tblNbsjTypeService;
	@Resource
	public FreeMarkerConfig freeMarkerConfig;
    @Resource
    public TblOrganizaService tblOrganizaService;
    @Resource
    public TblOtherarticleService tblOtherarticleService;
	@Resource
	public TblNbsjSheetService tBlNbsjSheetService;
	@Resource
	public TblNbsjFactbookService tblNbsjFactbookService;
	@Resource
	public TblNbsjAdvicenoteService tblNbsjAdvicenoteService;
	@Resource
    public TblNbsjAuditplanService tblNbsjAuditplanService;
	@Resource
	public TblNbsjProjectService tblnbsjProjectService;
	@Resource
	public TblReportService tblReportService;
	@Resource
	public TblNbsjBorrowRecordService tblNbsjBorrowRecordService;
    
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");//注意月份是MM
    
    
    /**
     * 查看当前流程图
 	 */
     @RequestMapping(value ="/picture", produces ="application/json; charset=utf-8", method = {RequestMethod.GET})
 	@ApiOperationSupport(order = 1)
  	@ApiOperation(value ="查看流程图--审计通用")
     public void lookCurrentProcessImage(HttpServletRequest request, HttpServletResponse response,
    		 @ApiParam(name="taskId",value="工作流任务主键",required=true) @RequestParam(value ="taskId", required = true) String taskId)throws IOException {
         InputStream imageStream = tblNbsjAuditplanService.lookCurrentProcessImage(taskId);
         byte[] b = new byte[1024];
         int len;
         while ((len = imageStream.read(b, 0, 1024)) != -1) {
             response.getOutputStream().write(b, 0, len);
         }
     }

	
    @RequestMapping(value ="/submitAuditPlanApproval", produces ="application/json; charset=utf-8", method = {RequestMethod.POST})
    @ApiOperationSupport(order = 1)
 	@ApiOperation(value ="审计计划-提交审批")
     public JsonBean submitAuditPlanApproval(HttpServletRequest request,
     		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
     		@ApiParam(name="planId",value="审计计划主键",required=true) @RequestParam(value ="planId", required = false) Integer planId) {
     	JsonBean jsonBean = null;
 		try {
 			jsonBean = this.tblNbsjAuditplanService.submitAuditplanArrpoval(token,planId);
 		} catch (Exception e) {
 			ResponseFormat.retParam(1,1000,e.getMessage());
 		}
 		return jsonBean;
     }
     
     @RequestMapping(value ="/getAuditPlanApprovalInfo", produces ="application/json; charset=utf-8", method = {RequestMethod.GET})
     @ApiOperationSupport(order = 2)
 	@ApiOperation(value ="审计计划管理-查看办理页面")
     public JsonBean getAuditPlanApprovalInfo(HttpServletRequest request,
     		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
     		@ApiParam(name="planId",value="审计计划主键",required=true) @RequestParam(value ="planId", required = true) Integer planId,
     		@ApiParam(name="taskId",value="工作流任务主键",required=true) @RequestParam(value ="taskId", required = true) String taskId,
     		@ApiParam(name="cyId",value="审批记录主键",required=true) @RequestParam(value ="cyId", required = true) Integer cyId) {
     	JsonBean jsonBean = null;
 		try {
 			jsonBean = this.tblNbsjAuditplanService.getAuditPlanApprovalInfo(token,planId,taskId,cyId);
 		} catch (Exception e) {
 			ResponseFormat.retParam(1,1000,e.getMessage());
 		}
 		return jsonBean;
     }
     
     
     @RequestMapping(value ="/dealAuditPlanApporvalInfo", produces ="application/json; charset=utf-8", method = {RequestMethod.POST})
     @ApiOperation(value ="审计计划管理-办理审批流程，通过或驳回")
     @ApiOperationSupport(order = 3)
 	public JsonBean dealAuditPlanApporvalInfo(HttpServletRequest request,HttpServletResponse response,
 			@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
 			@ApiParam(name="cyId",value="审批记录主键",required=true) @RequestParam(value ="cyId", required = true) Integer cyId,
 			@ApiParam(name="taskId",value="工作流任务主键",required=true) @RequestParam(value ="taskId", required = true) String taskId,
 			@ApiParam(name="planId",value="审计计划主键",required=true) @RequestParam(value ="planId", required = true) String planId,
 			@ApiParam(name="transition",value="办理结果 通过或驳回 同意或修改",required=true) @RequestParam(value ="transition", required = true) String transition,
 			@ApiParam(name="optDesc",value="审批意见",required=true) @RequestParam(value ="optDesc", required = true) String optDesc) {
     	
     	JsonBean jsonBean = null;
 		try {
 			jsonBean = this.tblNbsjAuditplanService.dealAuditPlanApporvalInfo(token,cyId,taskId,transition.trim(),optDesc,planId);
 		} catch (Exception e) {
 			ResponseFormat.retParam(1,1000,e.getMessage());
 		}
 		return jsonBean;
 	}
     @RequestMapping(value ="/submitProjectApproval", produces ="application/json; charset=utf-8", method = {RequestMethod.POST})
     @ApiOperationSupport(order = 5)
     @ApiOperation(value ="审计项目-提交审批")
     public JsonBean submitProjectApproval(HttpServletRequest request,
    		 @ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		 @ApiParam(name="projectId",value="审计项目主键",required=true) @RequestParam(value ="projectId", required = false) Integer projectId) {
    	 JsonBean jsonBean = null;
    	 try {
    		 jsonBean = this.tblnbsjProjectService.submitProjectArrpoval(token,projectId);
    	 } catch (Exception e) {
    		 ResponseFormat.retParam(1,1000,e.getMessage());
    	 }
    	 return jsonBean;
     }
     
     @RequestMapping(value ="/getProjectApprovalInfo", produces ="application/json; charset=utf-8", method = {RequestMethod.GET})
     @ApiOperationSupport(order = 6)
     @ApiOperation(value ="审计项目-查看办理页面")
     public JsonBean getProjectApprovalInfo(HttpServletRequest request,
    		 @ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		 @ApiParam(name="projectId",value="审计项目主键",required=true) @RequestParam(value ="projectId", required = true) Integer projectId,
    		 @ApiParam(name="taskId",value="工作流任务主键",required=true) @RequestParam(value ="taskId", required = true) String taskId,
    		 @ApiParam(name="cyId",value="审批记录主键",required=true) @RequestParam(value ="cyId", required = true) Integer cyId) {
    	 JsonBean jsonBean = null;
    	 try {
    		 jsonBean = this.tblnbsjProjectService.getProjectApprovalInfo(token,projectId,taskId,cyId);
    	 } catch (Exception e) {
    		 ResponseFormat.retParam(1,1000,e.getMessage());
    	 }
    	 return jsonBean;
     }
     
     
     @RequestMapping(value ="/dealProjectApporvalInfo", produces ="application/json; charset=utf-8", method = {RequestMethod.POST})
     @ApiOperation(value ="审计项目-办理审批流程，通过或驳回")
     @ApiOperationSupport(order = 7)
     public JsonBean dealProjectApporvalInfo(HttpServletRequest request,HttpServletResponse response,
    		 @ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		 @ApiParam(name="cyId",value="审批记录主键",required=true) @RequestParam(value ="cyId", required = true) Integer cyId,
    		 @ApiParam(name="taskId",value="工作流任务主键",required=true) @RequestParam(value ="taskId", required = true) String taskId,
    		 @ApiParam(name="projectId",value="审计项目主键",required=true) @RequestParam(value ="projectId", required = true) String projectId,
    		 @ApiParam(name="transition",value="办理结果 通过或驳回 同意或修改",required=true) @RequestParam(value ="transition", required = true) String transition,
    		 @ApiParam(name="optDesc",value="审批意见",required=true) @RequestParam(value ="optDesc", required = true) String optDesc) {
    	 
    	 JsonBean jsonBean = null;
    	 try {
    		 jsonBean = this.tblnbsjProjectService.dealProjectApporvalInfo(token,cyId,taskId,transition.trim(),optDesc,projectId);
    	 } catch (Exception e) {
    		 ResponseFormat.retParam(1,1000,e.getMessage());
    	 }
    	 return jsonBean;
     }
     @RequestMapping(value ="/submitTblAdvicenoteArrpoval", produces ="application/json; charset=utf-8", method = {RequestMethod.POST})
  	@ApiOperation(value ="审计通知书-提交审批")
     @ApiOperationSupport(order = 9)
      public JsonBean submitTblAdvicenoteArrpoval(HttpServletRequest request,
      		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
      		@ApiParam(name="adviceid",value="审计通知书id",required=true) @RequestParam(value ="adviceid", required = false) Integer adviceid) {
      	JsonBean jsonBean = null;
  		try {
  			jsonBean = this.tblNbsjAdvicenoteService.submitTblAdvicenoteArrpoval(token,adviceid);
  		} catch (Exception e) {
  			ResponseFormat.retParam(1,1000,e.getMessage());
  		}
  		return jsonBean;
      }
     @RequestMapping(value ="/getTblAdvicenoteApprovalInfo", produces ="application/json; charset=utf-8", method = {RequestMethod.GET})
 	@ApiOperation(value ="审计通知书-查看办理页面")
     @ApiOperationSupport(order = 10)
     public JsonBean getTblAdvicenoteApprovalInfo(HttpServletRequest request,
     		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
     		@ApiParam(name="adviceid",value="审计通知书id",required=true) @RequestParam(value ="adviceid", required = true) Integer adviceid,
     		@ApiParam(name="taskId",value="工作流任务主键",required=true) @RequestParam(value ="taskId", required = true) String taskId,
     		@ApiParam(name="cyId",value="审批记录主键",required=true) @RequestParam(value ="cyId", required = true) Integer cyId) {
     	JsonBean jsonBean = null;
 		try {
 			jsonBean = this.tblNbsjAdvicenoteService.getTblAdvicenoteApprovalInfo(token,adviceid,taskId,cyId);
 		} catch (Exception e) {
 			ResponseFormat.retParam(1,1000,e.getMessage());
 		}
 		return jsonBean;
     }
    @RequestMapping(value ="/dealTblAdvicenoteApporval", produces ="application/json; charset=utf-8", method = {RequestMethod.POST})
    @ApiOperation(value ="审计通知书-办理审批流程，通过或驳回")
    @ApiOperationSupport(order = 11)
	public JsonBean dealTblAdvicenoteApporval(HttpServletRequest request,HttpServletResponse response,
			@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
			@ApiParam(name="cyId",value="审批记录主键",required=true) @RequestParam(value ="cyId", required = true) Integer cyId,
			@ApiParam(name="taskId",value="工作流任务主键",required=true) @RequestParam(value ="taskId", required = true) String taskId,
			@ApiParam(name="adviceid",value="审计通知书id",required=true) @RequestParam(value ="adviceid", required = true) String adviceid,
			@ApiParam(name="transition",value="办理结果 通过或驳回 同意或修改",required=true) @RequestParam(value ="transition", required = true) String transition,
			@ApiParam(name="optDesc",value="审批意见",required=true) @RequestParam(value ="optDesc", required = true) String optDesc) {
    	
    	JsonBean jsonBean = null;
		try {
			jsonBean = this.tblNbsjAdvicenoteService.dealTblAdvicenoteApporval(token,cyId,taskId,transition.trim(),optDesc,adviceid);
		} catch (Exception e) {
			ResponseFormat.retParam(1,1000,e.getMessage());
		}
		return jsonBean;
	}

    @RequestMapping(value ="/submitTblNbsjSheetArrpoval", produces ="application/json; charset=utf-8", method = {RequestMethod.POST})
    @ApiOperation(value ="审计底稿-提交审批")
    @ApiOperationSupport(order = 20)
    public JsonBean submitTblNbsjSheetArrpoval(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="sheetid",value="审计底稿id",required=true) @RequestParam(value ="sheetid", required = false) Integer sheetid) {
    	JsonBean jsonBean = null;
    	try {
    		jsonBean = this.tBlNbsjSheetService.submitArrpoval(token,sheetid);
    	} catch (Exception e) {
    		ResponseFormat.retParam(1,1000,e.getMessage());
    	}
    	return jsonBean;
    }
    @RequestMapping(value ="/getTblNbsjSheetApprovalInfo", produces ="application/json; charset=utf-8", method = {RequestMethod.GET})
    @ApiOperation(value ="审计底稿-查看办理页面")
    @ApiOperationSupport(order = 21)
    public JsonBean getTblNbsjSheetApprovalInfo(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="sheetid",value="审计底稿id",required=true) @RequestParam(value ="sheetid", required = true) Integer sheetid,
    		@ApiParam(name="taskId",value="工作流任务主键",required=true) @RequestParam(value ="taskId", required = true) String taskId,
    		@ApiParam(name="cyId",value="审批记录主键",required=true) @RequestParam(value ="cyId", required = true) Integer cyId) {
    	JsonBean jsonBean = null;
    	try {
    		jsonBean = this.tBlNbsjSheetService.getApprovalInfo(token,sheetid,taskId,cyId);
    	} catch (Exception e) {
    		ResponseFormat.retParam(1,1000,e.getMessage());
    	}
    	return jsonBean;
    }
    @RequestMapping(value ="/dealTblNbsjSheetApporval", produces ="application/json; charset=utf-8", method = {RequestMethod.POST})
    @ApiOperation(value ="审计底稿-办理审批流程，通过或驳回")
    @ApiOperationSupport(order = 22)
    public JsonBean dealTblNbsjSheetApporval(HttpServletRequest request,HttpServletResponse response,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="cyId",value="审批记录主键",required=true) @RequestParam(value ="cyId", required = true) Integer cyId,
    		@ApiParam(name="taskId",value="工作流任务主键",required=true) @RequestParam(value ="taskId", required = true) String taskId,
    		@ApiParam(name="sheetid",value="审计底稿id",required=true) @RequestParam(value ="sheetid", required = true) String sheetid,
    		@ApiParam(name="transition",value="办理结果 通过或驳回 同意或修改",required=true) @RequestParam(value ="transition", required = true) String transition,
    		@ApiParam(name="optDesc",value="审批意见",required=true) @RequestParam(value ="optDesc", required = true) String optDesc) {
    	
    	JsonBean jsonBean = null;
    	try {
    		jsonBean = this.tBlNbsjSheetService.dealApporval(token,cyId,taskId,transition.trim(),optDesc,sheetid);
    	} catch (Exception e) {
    		ResponseFormat.retParam(1,1000,e.getMessage());
    	}
    	return jsonBean;
    }
    @RequestMapping(value ="/submitTblNbsjFactbookArrpoval", produces ="application/json; charset=utf-8", method = {RequestMethod.POST})
    @ApiOperation(value ="事实确认书-提交审批")
    @ApiOperationSupport(order = 30)
    public JsonBean submitTblNbsjFactbookArrpoval(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="factid",value="事实确认书id",required=true) @RequestParam(value ="factid", required = false) Integer factid) {
    	JsonBean jsonBean = null;
    	try {
    		jsonBean = this.tblNbsjFactbookService.submitArrpoval(token,factid);
    	} catch (Exception e) {
    		ResponseFormat.retParam(1,1000,e.getMessage());
    	}
    	return jsonBean;
    }
    @RequestMapping(value ="/getTblNbsjFactbookApprovalInfo", produces ="application/json; charset=utf-8", method = {RequestMethod.GET})
    @ApiOperation(value ="事实确认书-查看办理页面")
    @ApiOperationSupport(order = 31)
    public JsonBean getTblNbsjFactbookApprovalInfo(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="factid",value="事实确认书id",required=true) @RequestParam(value ="factid", required = true) Integer factid,
    		@ApiParam(name="taskId",value="工作流任务主键",required=true) @RequestParam(value ="taskId", required = true) String taskId,
    		@ApiParam(name="cyId",value="审批记录主键",required=true) @RequestParam(value ="cyId", required = true) Integer cyId) {
    	JsonBean jsonBean = null;
    	try {
    		jsonBean = this.tblNbsjFactbookService.getApprovalInfo(token,factid,taskId,cyId);
    	} catch (Exception e) {
    		ResponseFormat.retParam(1,1000,e.getMessage());
    	}
    	return jsonBean;
    }
    @RequestMapping(value ="/dealTblNbsjFactbookApporval", produces ="application/json; charset=utf-8", method = {RequestMethod.POST})
    @ApiOperation(value ="事实确认书-办理审批流程，通过或驳回")
    @ApiOperationSupport(order = 32)
    public JsonBean dealTblNbsjFactbookApporval(HttpServletRequest request,HttpServletResponse response,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="cyId",value="审批记录主键",required=true) @RequestParam(value ="cyId", required = true) Integer cyId,
    		@ApiParam(name="taskId",value="工作流任务主键",required=true) @RequestParam(value ="taskId", required = true) String taskId,
    		@ApiParam(name="factid",value="事实确认书id",required=true) @RequestParam(value ="factid", required = true) String factid,
    		@ApiParam(name="transition",value="办理结果 通过或驳回 同意或修改",required=true) @RequestParam(value ="transition", required = true) String transition,
    		@ApiParam(name="optDesc",value="审批意见",required=true) @RequestParam(value ="optDesc", required = true) String optDesc) {
    	
    	JsonBean jsonBean = null;
    	try {
    		jsonBean = this.tblNbsjFactbookService.dealApporval(token,cyId,taskId,transition.trim(),optDesc,factid);
    	} catch (Exception e) {
    		ResponseFormat.retParam(1,1000,e.getMessage());
    	}
    	return jsonBean;
    }
    
    @RequestMapping(value ="/submitReportZqyjApproval", produces ="application/json; charset=utf-8", method = {RequestMethod.POST})
    @ApiOperationSupport(order = 40)
 	@ApiOperation(value ="审计报告-征求意见")
     public JsonBean submitReportZqyjApproval(HttpServletRequest request,
     		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
     		@ApiParam(name="reportid",value="审计报告主键",required=true) @RequestParam(value ="reportid", required = false) Integer reportid) {
     	JsonBean jsonBean = null;
 		try {
 			jsonBean = this.tblReportService.submitReportZqyjApproval(token,reportid);
 		} catch (Exception e) {
 			ResponseFormat.retParam(1,1000,e.getMessage());
 		}
 		return jsonBean;
     }
    @RequestMapping(value ="/submitReportFhApproval", produces ="application/json; charset=utf-8", method = {RequestMethod.POST})
    @ApiOperationSupport(order = 41)
    @ApiOperation(value ="审计报告-提交复核")
    public JsonBean submitReportFhApproval(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="reportid",value="审计报告主键",required=true) @RequestParam(value ="reportid", required = false) Integer reportid) {
    	JsonBean jsonBean = null;
    	try {
    		jsonBean = this.tblReportService.submitReportFhApproval(token,reportid);
    	} catch (Exception e) {
    		ResponseFormat.retParam(1,1000,e.getMessage());
    	}
    	return jsonBean;
    }
    @RequestMapping(value ="/submitReportSpApproval", produces ="application/json; charset=utf-8", method = {RequestMethod.POST})
    @ApiOperationSupport(order = 41)
    @ApiOperation(value ="审计报告-提交审批")
    public JsonBean submitReportSpApproval(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="reportid",value="审计报告主键",required=true) @RequestParam(value ="reportid", required = false) Integer reportid) {
    	JsonBean jsonBean = null;
    	try {
    		jsonBean = this.tblReportService.submitReportSpApproval(token,reportid);
    	} catch (Exception e) {
    		ResponseFormat.retParam(1,1000,e.getMessage());
    	}
    	return jsonBean;
    }
     
     @RequestMapping(value ="/getReportFhApprovalInfo", produces ="application/json; charset=utf-8", method = {RequestMethod.GET})
     @ApiOperationSupport(order = 42)
 	@ApiOperation(value ="审计报告-查看办理页面")
     public JsonBean getReportFhApprovalInfo(HttpServletRequest request,
     		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
     		@ApiParam(name="reportid",value="审计报告主键",required=true) @RequestParam(value ="reportid", required = true) Integer reportid,
     		@ApiParam(name="taskId",value="工作流任务主键",required=true) @RequestParam(value ="taskId", required = true) String taskId,
     		@ApiParam(name="cyId",value="审批记录主键",required=true) @RequestParam(value ="cyId", required = true) Integer cyId) {
     	JsonBean jsonBean = null;
 		try {
 			jsonBean = this.tblReportService.getReportFhApprovalInfo(token,reportid,taskId,cyId);
 		} catch (Exception e) {
 			ResponseFormat.retParam(1,1000,e.getMessage());
 		}
 		return jsonBean;
     }
     
     
     @RequestMapping(value ="/dealReportFhApporvalInfo", produces ="application/json; charset=utf-8", method = {RequestMethod.POST})
     @ApiOperation(value ="审计报告-办理审批流程，通过或驳回")
     @ApiOperationSupport(order = 43)
 	public JsonBean dealReportFhApporvalInfo(HttpServletRequest request,HttpServletResponse response,
 			@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
 			@ApiParam(name="cyId",value="审批记录主键",required=true) @RequestParam(value ="cyId", required = true) Integer cyId,
 			@ApiParam(name="taskId",value="工作流任务主键",required=true) @RequestParam(value ="taskId", required = true) String taskId,
 			@ApiParam(name="reportid",value="审计报告主键",required=true) @RequestParam(value ="reportid", required = true) String reportid,
 			@ApiParam(name="transition",value="办理结果 通过或驳回 同意或修改",required=true) @RequestParam(value ="transition", required = true) String transition,
 			@ApiParam(name="optDesc",value="审批意见",required=true) @RequestParam(value ="optDesc", required = true) String optDesc) {
     	
     	JsonBean jsonBean = null;
 		try {
 			jsonBean = this.tblReportService.dealReportFhApporvalInfo(token,cyId,taskId,transition.trim(),optDesc,reportid);
 		} catch (Exception e) {
 			ResponseFormat.retParam(1,1000,e.getMessage());
 		}
 		return jsonBean;
 	}
     @RequestMapping(value ="/submitRecordApproval", produces ="application/json; charset=utf-8", method = {RequestMethod.POST})
     @ApiOperationSupport(order = 44)
     @ApiOperation(value ="审计档案借阅-提交审批")
     public JsonBean submitRecordApproval(HttpServletRequest request,
    		 @ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		 @ApiParam(name="borrowid",value="主键",required=true) @RequestParam(value ="borrowid", required = false) Integer borrowid) {
    	 JsonBean jsonBean = null;
    	 try {
    		 jsonBean = this.tblNbsjBorrowRecordService.submitRecordApproval(token,borrowid);
    	 } catch (Exception e) {
    		 ResponseFormat.retParam(1,1000,e.getMessage());
    	 }
    	 return jsonBean;
     }
     
     @RequestMapping(value ="/getRecordApprovalInfo", produces ="application/json; charset=utf-8", method = {RequestMethod.GET})
     @ApiOperationSupport(order = 45)
     @ApiOperation(value ="审计档案借阅-查看办理页面")
     public JsonBean getRecordApprovalInfo(HttpServletRequest request,
    		 @ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		 @ApiParam(name="borrowid",value="主键",required=true) @RequestParam(value ="borrowid", required = true) Integer borrowid,
    		 @ApiParam(name="taskId",value="工作流任务主键",required=true) @RequestParam(value ="taskId", required = true) String taskId,
    		 @ApiParam(name="cyId",value="审批记录主键",required=true) @RequestParam(value ="cyId", required = true) Integer cyId) {
    	 JsonBean jsonBean = null;
    	 try {
    		 jsonBean = this.tblNbsjBorrowRecordService.getRecordApprovalInfo(token,borrowid,taskId,cyId);
    	 } catch (Exception e) {
    		 ResponseFormat.retParam(1,1000,e.getMessage());
    	 }
    	 return jsonBean;
     }
     
     
     @RequestMapping(value ="/dealRecordApporvalInfo", produces ="application/json; charset=utf-8", method = {RequestMethod.POST})
     @ApiOperation(value ="审计档案借阅-办理审批流程，通过或驳回")
     @ApiOperationSupport(order = 46)
     public JsonBean dealRecordApporvalInfo(HttpServletRequest request,HttpServletResponse response,
    		 @ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		 @ApiParam(name="cyId",value="审批记录主键",required=true) @RequestParam(value ="cyId", required = true) Integer cyId,
    		 @ApiParam(name="taskId",value="工作流任务主键",required=true) @RequestParam(value ="taskId", required = true) String taskId,
    		 @ApiParam(name="borrowid",value="主键",required=true) @RequestParam(value ="borrowid", required = true) String borrowid,
    		 @ApiParam(name="transition",value="办理结果 通过或驳回 同意或修改",required=true) @RequestParam(value ="transition", required = true) String transition,
    		 @ApiParam(name="optDesc",value="审批意见",required=true) @RequestParam(value ="optDesc", required = true) String optDesc) {
    	 
    	 JsonBean jsonBean = null;
    	 try {
    		 jsonBean = this.tblNbsjBorrowRecordService.dealRecordApporvalInfo(token,cyId,taskId,transition.trim(),optDesc,borrowid);
    	 } catch (Exception e) {
    		 ResponseFormat.retParam(1,1000,e.getMessage());
    	 }
    	 return jsonBean;
     }
    
}
